package com.hibuy.pc.util;

import org.apache.log4j.Logger;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

@Component
public class ThreadPoolUtil {
    private Logger logger = Logger.getLogger(ThreadPoolUtil.class);

    @Async("myExecutor") //配置类中的方法名
    public void useThread(){
        logger.info("MultiThreadProcessService-processSomething" + Thread.currentThread() + "......start");
       try {
               Thread.sleep(1000);
           } catch (InterruptedException e) {
               throw new RuntimeException(e);
           }
       logger.info("MultiThreadProcessService-processSomething" + Thread.currentThread() + "......end");

    }

}
